package main

import (
	"context"
	"hg/pkg/minio/storage"
	"log"

	"github.com/sirupsen/logrus"
)

func main() {
	ctx := context.Background()
	endpoint := "oss-cn-beijing.aliyuncs.com"
	accessKeyID := "LTAI5tRdHgbXrJd1vzZmV7Yy"
	secretAccessKey := "r2G8CUriwbhLPSxgD8koO2fa42HSyY"
	useSSL := true
	bucketName := "my-video123"

	err := storage.NewS3Client(endpoint, accessKeyID, secretAccessKey, useSSL)
	if err != nil {
		logrus.Errorln(err)
	}
	// Upload the zip file
	objectName := "class_test.mp4"
	filePath := "C:/Users/刘雨卓/Desktop/video项目/material/video.mp4"

	if err = storage.FputObject(ctx, bucketName, objectName, filePath); err != nil {
		panic(err)
	}
	log.Printf("Successfully uploaded %s \n", objectName)
}
